package cn.tedu._03vehicle.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;

import javax.validation.constraints.*;
import java.util.Date;

@Data
public class UserRegParam {
    //全局异常处理器中:ex.getFieldError().getDefaultMessage()结果: 用户名不能为null
    //@NotNull(message = "用户名不能为null")
    @NotEmpty(message = "用户名不能为null和空字符串")
    //@NotBlank(message = "用户名不能为null和空字符串和空白串")
    //@Size(min = 6,max = 20,message = "用户名长度必须在6到20之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,7}$|^[a-zA-Z]{1,14}$", message = "用户名不能超过7个汉字或14个英文字符")
    @ApiModelProperty(value = "用户名",required = true)
    private String username;
    @ApiModelProperty(value = "密码",required = true)
    private String password;
    @ApiModelProperty(value = "邮箱",required = true)
    private String email;
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;
}
